package com.zhentao.schedule;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @Date 2024/5/23 10:30
 * @Author xdm
 **/
@Component
public class Test1 {

    @Scheduled(cron = "*/5 */2 1 * * ?")
    public void test1(){
        System.out.println(""+(new Date()).toLocaleString());
    }

/*
    @Scheduled(cron = "0/1 * * * * ?")
    public void test1(){
        System.out.println("每一秒执行一次");
    }

    @Scheduled(cron = "0/5 * * * * ?")
    public void test2(){
        System.out.println("每五秒访问一次");
    }
*/


}
